<?php

/*

Process Login (login.pro.php)

*/
ob_start();
include "global.inc.php";

$encrypted_password = md5($login_password);

$check = fetch("SELECT username,password FROM members2 WHERE username = '$login_username' AND password = '$encrypted_password' AND game = '$game'");

if ($check[username])
{
	setcookie("username_$game",$check[username],time()+2678400);
	setcookie("password_$game",$check[password],time()+2678400);
	header("Location: $base_url/index.php?game=$game");
}
else
{
	header("Location: $base_url/login.php?game=$game&error=Error+logging+in.+Have+you+created+an+account+yet?+Passwords+are+caSe+SEnsITIvE.");
}

?>